package rs.etf.kdp.server;

import java.io.Serializable;

public class TokenizedConnection implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 7988620700320444618L;
	long srcID;
	long srcPort;
	long dstID;
	long dstPort;
	
	public TokenizedConnection(long srcID, long srcPort, long dstID, long dstPort) {
		this.srcID = srcID;
		this.srcPort = srcPort;
		this.dstID = dstID;
		this.dstPort = dstPort;
	}

	public long getSrcID() {
		return srcID;
	}

	public void setSrcID(long srcID) {
		this.srcID = srcID;
	}

	public long getSrcPort() {
		return srcPort;
	}

	public void setSrcPort(long srcPort) {
		this.srcPort = srcPort;
	}

	public long getDstID() {
		return dstID;
	}

	public void setDstID(long dstID) {
		this.dstID = dstID;
	}

	public long getDstPort() {
		return dstPort;
	}

	public void setDstPort(long dstPort) {
		this.dstPort = dstPort;
	}
	
	
	public boolean equals(Object obj)
	{
		 if (obj == null)
	         return false;
	     if (obj == this)
	         return true;
	     if (obj.getClass() != getClass())
	    	 return false;
	     
	     TokenizedConnection compare = (TokenizedConnection)obj;
	     
	     if((compare.dstID == dstID) && (compare.dstPort == dstPort) && (compare.srcID == srcID) && (compare.srcPort == srcPort))
	     {
	    	 return true;
	     }
	     else
	     {
	    	 return false;
	     }
	     
	}
	
}
